package com.taotao.usercoupon.service.impl;

import com.taotao.common.security.utils.SecurityUtils;
import com.taotao.coupon.domain.UserCoupon;
import com.taotao.system.model.LoginUser;
import com.taotao.usercoupon.mapper.UserCouponMapper;
import com.taotao.usercoupon.service.UserCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
  *@ClassName UserCouponServiceImpl
  *@Description 描述
  *@Author ChangLe.Liu
  *@Date 2025/1/14 19:54
 */
@Service
public class UserCouponServiceImpl implements UserCouponService{
    @Autowired
    private UserCouponMapper userCouponMapper;
    /**
     * 用户优惠卷列表
     *
     * @param
     * @return
     */
    @Override
    public List<UserCoupon> userCouponsList(Integer status) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        Long userId = loginUser.getUserid();
//        Long userId = 1L;
        List<UserCoupon>userCouponsList= userCouponMapper.userCouponsList(userId,status);
        return userCouponsList;
    }
}
